package com.usian.admin.controller;

import com.usian.admin.service.AdSensitiveService;
import com.usian.api.admin.SensitiveControllerApi;
import com.usian.model.admin.dtos.SensitiveDto;
import com.usian.model.admin.pojos.AdSensitive;
import com.usian.model.common.dtos.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api/v1/sensitive")
public class AdSensitiveController implements SensitiveControllerApi {

    @Autowired
    private AdSensitiveService adSensitiveService;

    @Override
    @PostMapping("/list")
    public ResponseResult findPage(@RequestBody SensitiveDto dto) {
        return adSensitiveService.findPage(dto);
    }

    @Override
    @PostMapping("/save")
    public ResponseResult AddAdSensitive(@RequestBody AdSensitive adSensitive) {
        return adSensitiveService.addSensitive(adSensitive);
    }

    @Override
    @PostMapping("/update")
    public ResponseResult updateAdSensitive(@RequestBody AdSensitive adSensitive) {
        return adSensitiveService.updateAdSensitive(adSensitive);
    }

    @Override
    @DeleteMapping("/del/{id}")
    public ResponseResult delById(@PathVariable Integer id) {
        return adSensitiveService.delById(id);
    }
}
